package cn.aitstone.basic.mapper;

import cn.aitstone.basic.query.BaseQuery;

import java.util.List;
/**
 * @Description: 公共mapper
 * @Author: Sheldon
 * @Version: 1.0
 * @Date:  2022/7/1 21:21
 */
public interface BaseMapper<T> {

    /**
     * @Title: 查询方法
     * @Description: 查询所有
     * @Author: Sheldon
     * @Version: 1.0
     * @Date:  2022/6/21 19:28
     * @Parameters: []
     * @Return java.util.List<cn.aitstone.org.domain.T>
     */
    List<T> loadAll();

    /**
     * @Title: loadById
     * @Description: 根据id查询
     * @Author: Sheldon
     * @Version: 1.0
     * @Date:  2022/6/21 19:29
     * @Parameters: [id]
     * @Return cn.aitstone.org.domain.T
     */
    T loadById(Long id);

    /**
     * @Title: remove
     * @Description: 根据id删除
     * @Author: Sheldon
     * @Version: 1.0
     * @Date:  2022/6/21 19:30
     * @Parameters: [id]
     * @Return void
     */
    void remove(Long id);

    /**
     * @Title: save
     * @Description: 新增
     * @Author: Sheldon
     * @Version: 1.0
     * @Date:  2022/6/21 19:30
     * @Parameters: [t]
     * @Return void
     */
    void save(T t);

    /**
     * @Title: update
     * @Description: 根据Id修改
     * @Author: Sheldon
     * @Version: 1.0
     * @Date:  2022/6/21 19:30
     * @Parameters: [t]
     * @Return void
     */
    void update(T t);

    /**
     * @Title: queryData
     * @Description: 分页+高级查询
     * @Author: Sheldon
     * @Version: 1.0
     * @Date:  2022/6/21 19:31
     * @Parameters: [baseQuery]
     * @Return java.util.List<cn.aitstone.org.domain.T>
     */
    List<T> queryData(BaseQuery baseQuery);

    /**
     * @Title: queryCount
     * @Description: 查询总条数
     * @Author: Sheldon
     * @Version: 1.0
     * @Date:  2022/6/21 19:31
     * @Parameters: [baseQuery]
     * @Return java.lang.Integer
     */
    Integer queryCount(BaseQuery baseQuery);

    /**
     * @Title: batchdel
     * @Description: 批量删除
     * @Author: Sheldon
     * @Version: 1.0
     * @Date:  2022/6/25 20:52
     * @Parameters: [ids]
     * @Return void
     */
    void batchdel(Long[] ids);
}
